(PE-45697) Content-validate PuppetDB readiness over the ssl status port - #280
Merged
joshcooper merged 1 commit intoAug 14, 2026
Merged
Conversation
sleep_until_puppetdb_started's ssl leg was a bare curl_with_retries liveness probe (accepts SSL error codes 35/60) -- it confirms the tls port answers, not that PuppetDB reports a running state. Since PE-45384/PE-44906 disabled the cleartext listener by default, the running-state content check now only ran on the (best-effort, swallowed) nonssl leg, so on modern hosts it never ran at all -- reopening the "port up but not ready" race the content check originally guarded. Make an ssl content check the primary readiness gate: /status/v1/* (and the pre-4.0 /pdb/meta fallback) is allow-unauthenticated with jetty client-auth=want, so `curl -k` content-validates with no client cert and works even when the cleartext listener is disabled -- the same endpoint and reasoning as a sibling beaker-pe fix [1]. If the ssl status endpoint does not serve unauthenticated content (older/nonstandard config), degrade to the previous behaviour (bare ssl liveness probe + best-effort nonssl check) rather than failing. [1]: puppetlabs/beaker-pe#313 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
joshcooper
approved these changes
Aug 14, 2026
joshcooper
deleted the
PE-45697/main/puppetdb-ssl-readiness-content-check
branch
August 14, 2026 20:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening on PE-45697 (does not reopen the ticket — the original fix shipped in 4.4.2 and stays as-is).
Background
PE-45697 stopped
sleep_until_puppetdb_startedfrom burning ~120 retries against PuppetDB's cleartext status port after it became disabled-by-default (PE-45384 / PE-44906, SECVULN-1792). It made the ssl leg the primary gate:That
curl_with_retriesrunscurl -m 1 https://<node>:8081and accepts exit codes 35/60 (SSL connect / cert-verify error) as success — it confirms the TLS port answers, not that PuppetDB reports"state" : "running". The running-state content validation then only ran on the nonssl leg, which is best-effort (max_retries: 5) and swallowed. So on modern hosts (cleartext disabled) the readiness content check effectively never runs — reopening the "port up but PuppetDB not ready" race the check was originally added to guard (PE-14934).Note: this leg was byte-identical before and after PE-45697 — the SSL path was always a bare TLS probe; PE-45697 just promoted it to primary. This PR is the follow-up hardening, not a regression fix on PE-45697 itself.
Change
Make an ssl content check the primary readiness gate:
curl -m 1 -k https://localhost:8081/<endpoint> | grep '<running-regex>'./status/v1/*(and the pre-4.0/pdb/metafallback) isallow-unauthenticatedand PuppetDB's jetty listener isclient-auth = want, socurl -kcontent-validates with no client cert and works even when the cleartext listener is disabled — the same endpoint and reasoning as the sibling beaker-pe fix #313.If the ssl status endpoint doesn't serve unauthenticated content (older / nonstandard config), it degrades to the previous behaviour — a bare ssl liveness probe plus a best-effort nonssl content check — rather than failing. So this can't regress any currently-working path; worst case it behaves exactly like today.
Testing
bundle exec rspec spec/beaker-puppet/helpers/puppet_helpers_spec.rb -e sleep_until_puppetdb_started— 10 examples, 0 failures (happy path, port overrides, both pe_ver endpoint branches, the fallback path, disabled-nonssl swallow, and unrelated-RuntimeError propagation for both legs).rubocopclean.Related
/statusassumption; both benefit from the same live re-verify).🤖 Generated with Claude Code